<?php

class Application_Form_RegisterUser extends Zend_Dojo_Form
{

    public function init()
    {
        $this->setMethod('POST');
        $name   = new Zend_Dojo_Form_Element_TextBox(
                    'name', 
                    array(
                        'label'      => 'Name',
                        'required'   => true,
                        )
                    );
        
        $email  = new Zend_Dojo_Form_Element_TextBox(
                    'email',
                    array(
                        'label'      => 'Email',
                        'validators' => array(),
                        'required'   => true,
                        )
                    );
        
        $pw1    = new Zend_Dojo_Form_Element_PasswordTextBox(
                    'pw',
                    array(
                        'label'     => 'Passwort', 
                        'required'   => true,
                        )
                    );
        
        $pw2    = new Zend_Dojo_Form_Element_PasswordTextBox(
                    'pw2',
                    array(
                        'label'      => 'Passwort',
                        'required'   => true,
                        'validators' => array(
                            array('identical', false, array('token' => 'pw',))
                        ),
                        )
                    );
        
        $submit = new Zend_Dojo_Form_Element_SubmitButton(
                    'submit',
                    array(
                        'label'     => 'Fertig',
                        'required'  => false,
                        'ignore'    => true,
                    ));
        
        $this->addElements(
                array(
                    $name,
                    $email,
                    $pw1,
                    $pw2,
                    $submit,
                    )
                );
    }


}

